#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 12 21:34:43 2017

@author: awei
"""

import cv2
from matplotlib import pyplot as plt  

ImgName = 'F:/awei/code/mark/mark5.bmp'

img = cv2.imread( ImgName, cv2.IMREAD_GRAYSCALE)
drawImg = cv2.imread( ImgName, cv2.IMREAD_COLOR)
# dector = cv2.BRISK_create( thresh=30, octaves=3, patternScale=1.0)
# dector = cv2.ORB_create()
#dector = cv2.FastFeatureDetector_create(20)
#dector = cv2.AgastFeatureDetector_create(20 )
#dector = cv2.GFTTDetector_create(20)
#dector = cv2.KAZE_create()
dector = cv2.AKAZE_create()
#dector = cv2.xfeatures2d.FREAK_create()
#dector = cv2.xfeatures2d.BoostDesc_create()
#dector = cv2.xfeatures2d.BriefDescriptorExtractor_create()
#dector = cv2.xfeatures2d.HarrisLaplaceFeatureDetector_create()
#dector = cv2.xfeatures2d.SIFT_create()
#dector = cv2.xfeatures2d.SURF_create()
#dector = cv2.xfeatures2d.StarDetector_create(maxSize=700000)
#dector = cv2.xfeatures2d.VGG_create()

keypoints = dector.detect(img)
#keypoints,des = dector.compute(img,None)
cv2.imshow( "img", img )
cv2.drawKeypoints(img, keypoints, drawImg, (255,0,0) )
plt.imshow(drawImg, cmap = 'gray')
#plt.xticks([]), plt.yticks([])#去除横纵坐标  
plt.show()  